package com.yantong.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * 端口类型
 *
 * @author liaozhaogui-773104632@qq.com
 * @date 2021/4/7 10:02
 */
public enum OrderPortTypeEnum {
	MINI_ROGRAM(0, "小程序"),
	LIFE(1, "公众号本地生活"),
	CARD(2, "公众号电子名片"),
	;

	private int code;
	private String msg;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}



	private static Map<Integer, String> all= new HashMap<>();
	static{
		for(OrderPortTypeEnum orderPortTypeEnum: EnumSet.allOf(OrderPortTypeEnum.class)){
			all.put(orderPortTypeEnum.code, orderPortTypeEnum.msg);
		}
	}
	public static String get(Integer code){
		return all.get(code);
	}

	OrderPortTypeEnum(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}
}
